<?php

function getTabeSize($a, $b) {
    return byte_format($a + $b);
}

function byte_format($size, $dec=2) {
    $a = array("B", "KB", "MB", "GB", "TB", "PB");
    $pos = 0;
    while ($size >= 1024) {
        $size /= 1024;
        $pos++;
    }
    return round($size, $dec) . " " . $a[$pos];
}

/**
  +--------------------------------------------------------------------------
 * 功能：生成文件
  +--------------------------------------------------------------------------
 * @access protected
  +--------------------------------------------------------------------------
 * @return void
  +--------------------------------------------------------------------------
 * @param <string> $filename 文件名
 * @param <string> $content  需要写入的内容
  +-----------------------------------------------------------------------------
 */
function make_files($filename, $content) {
    //$content  = iconv( 'GB2312', "UTF-8" ,$content  );
    $file = APP_PATH . "/Amfiles/" . $filename;
    $fp = fopen($file, 'w+');
    fwrite($fp, $content); 
    fclose($fp);
}

//js返回
function goBack(){
    $str = '<a href="javascript:history.go(-1);">返回</a><br>';
    echo $str;
}

?>